<div class="main layui-clear">
    <div class="wrap">
        <div class="content">
            <div class="fly-tab fly-tab-index">
                <span>
                    <a href="/" class="tab-this">全部</a>
                    <a href="{:U('home/index/unsolved')}">未结帖</a>
                    <a href="{:U('home/index/solved')}">已采纳</a>
                    <a href="{:U('home/index/wonderful')}">精帖</a>
                    <a href="{:U('home/users/index')}">我的帖</a>
                </span>
                <form action="{:U('home/index/search')}" class="fly-search">
                    <i type="submit" class="iconfont icon-sousuo"></i>
                    <input class="layui-input" autocomplete="off" placeholder="搜索内容，回车跳转" type="text" name="q">

                </form>
                <a href="{:U('home/Wen/index')}" class="layui-btn jie-add">发表新帖</a>
            </div>
            <ul class="fly-panel fly-list fly-list-top">
                <?php foreach ($info as  $row) { ?>
                <?php if (in_array('1', explode(',', $row['state']))) { ?>
                <li class="fly-list-li">
                    <a href="{:U('home/u/index',array('id'=>$row['uid']))}" class="fly-list-avatar">
                        <img src="__ROOT__<?php echo $row['face'] ?>   " alt="<?php echo $row['nickname'] ?>">
                    </a>
                    <h2 class="fly-tip" style="">
                        <a href="{:U('home/contg/index',array('id'=>$row['id']))}"><?php echo $row['title'] ?></a>

                        <?php if (in_array('1', explode(',', $row['state']))) { ?>
                            <span class="fly-tip-stick" style="display:inline-block">置顶</span>
                        <?php } ?>

                        <?php if (in_array('2', explode(',', $row['state']))) { ?>
                             <span class="fly-tip-jing" style="display:inline-block">精帖</span>
                        <?php } ?>
                    </h2>
                    <p>
                        <span>
                            <a href="{:U('home/u/index',array('id'=>$row['uid']))}"><?php echo $row['nickname'] ?></a>
                        </span>
                        <span><?php echo CT($row['create_time']) ?></span>
                        <span><?php echo $row['cname'] ?></span>
                        <span class="fly-list-hint">
                            <i class="iconfont" title="回答"></i><?php echo $row['answer_num'] ?>
                            <i class="iconfont" title="人气"></i><?php echo $row['view_num'] ?>
                        </span>
                    </p>
                </li>
                <?php } ?>
                <?php }?>
            </ul>
            <ul class="fly-panel fly-list">
                <?php foreach ($infos as $row) { ?>
                <li class="fly-list-li">
                    <a href="{:U('home/u/index',array('id'=>$row['uid']))}" class="fly-list-avatar">
                        <img src="__ROOT__<?php echo $row['face'] ?>" alt="<?php echo $row['nickname'] ?>">
                    </a>
                    <h2 class="fly-tip">
                        <a href="{:U('home/contg/index',array('id'=>$row['id']))}"><?php echo $row['title'] ?></a>
                    </h2>
                    <p>
                        <span><a href="{:U('home/u/index',array('id'=>$row['uid']))}"><?php echo $row['nickname'] ?></a></span>
                        <span><?php echo CT($row['create_time']) ?></span>
                        <span><?php echo $row['cname'] ?></span>
                        <span class="fly-list-hint">
                            <i class="iconfont" title="回答"></i><?php echo $row['answer_num'] ?>
                            <i class="iconfont" title="人气"></i><?php echo $row['view_num'] ?>
                        </span>
                    </p>
                </li>
               <?php } ?>

            </ul>
            <div style="text-align: center">
                <div class="laypage-main">
                    <?php echo $page ?>
                </div>
                <style type="text/css">
                .laypage-main{
                    border: 0px solid #000;
                }
                .laypage-main div{
                    border: 0px solid #000;
                }
                .laypage-main a{
                    display: inline-block;
                    margin-left: 10px;
                    border: 1px solid #009E94;
                }

                .laypage-main span{
                    margin-left: 10px;
                    border: 1px solid #009E94;
                    background: #009E94 url() 0 0 no-repeat;
                    color: #fff;
                }

                </style>
            </div>
        </div>
    </div>
    <div class="edge">
        <div class="fly-panel leifeng-rank"><h3 class="fly-panel-title">近一月回答榜 - TOP 12</h3>
            <dl>
                <?php foreach ($users as  $row) { ?>
                <dd><a href="{:U('home/u/index',array('id'=>$row['id']))}"> <img src="__ROOT__<?php echo $row['face'] ?>">
                    <cite><?php echo $row['nickname'] ?></cite> <i><?php echo $row['answer_num'] ?>次回答</i> </a>
                </dd>
               <?php } ?>
                
            </dl>
        </div>
        <dl class="fly-panel fly-list-one">
            <dt class="fly-panel-title">最近热帖</dt>
            <?php foreach ($hotview as $row) { ?>
                <dd>
                    <a href="{:U('home/contg/index',array('id'=>$row['id']))}"><?php echo $row['title'] ?></a>
                    <span><i class="iconfont"></i><?php echo $row['view_num'] ?></span>
                </dd>
           <?php } ?>

        </dl>
        <dl class="fly-panel fly-list-one">
            <dt class="fly-panel-title">近期热议</dt>
            <?php foreach ($hotanswer as $row) { ?>
                <dd>
                    <a href="{:U('home/contg/index',array('id'=>$row['id']))}"><?php echo $row['title'] ?></a>
                    <span><i class="iconfont"></i><?php echo $row['answer_num'] ?></span>
            </dd>
            <?php } ?>
        </dl>
        <div class="fly-panel fly-link"><h3 class="fly-panel-title">友情链接</h3>
            <dl>
                <?php foreach ($link as $v) { ?>
                <dd><a href="<?php echo $v['url'] ?>" target="_blank"><?php echo $v['title'] ?></a></dd>
                <?php } ?>
            </dl>
        </div>
    </div>
</div>